<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="MunicipioCreateDlg" widgetVar="MunicipioCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="Ingresar Nuevo Municipio">
            <h:form id="MunicipioCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{municipioController.selected != null}">
                        <p:outputLabel value="Municipio" for="nmbmunicipio" />
                        <p:inputText id="nmbmunicipio" value="#{municipioController.selected.nmbmunicipio}" title="#{bundle.CreateMunicipioTitle_nmbmunicipio}" required="true" requiredMessage="#{bundle.CreateMunicipioRequiredMessage_nmbmunicipio}"/>
                        <p:outputLabel value="Departamento" for="iddpto" />
                        <p:selectOneMenu id="iddpto" value="#{municipioController.selected.iddpto}" required="true" requiredMessage="#{bundle.EditMunicipioRequiredMessage_iddpto}">
                            <f:selectItems value="#{departamentoController.itemsAvailableSelectOne}"
                                           var="iddptoItem"
                                           itemValue="#{iddptoItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{municipioController.create}" value="#{bundle.Save}" update="display,:MunicipioListForm:datalist,:growl" oncomplete="handleSubmit(args,'MunicipioCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="MunicipioCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
